package com.ruoyi.video.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.video.mapper.VideoCompanyMapper;
import com.ruoyi.video.domain.VideoCompany;
import com.ruoyi.video.service.IVideoCompanyService;
import com.ruoyi.common.core.text.Convert;

/**
 * 公司Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-07
 */
@Service
public class VideoCompanyServiceImpl implements IVideoCompanyService 
{
    @Autowired
    private VideoCompanyMapper videoCompanyMapper;

    /**
     * 查询公司
     * 
     * @param id 公司主键
     * @return 公司
     */
    @Override
    public VideoCompany selectVideoCompanyById(Integer id)
    {
        return videoCompanyMapper.selectVideoCompanyById(id);
    }

    /**
     * 查询公司列表
     * 
     * @param videoCompany 公司
     * @return 公司
     */
    @Override
    public List<VideoCompany> selectVideoCompanyList(VideoCompany videoCompany)
    {
        return videoCompanyMapper.selectVideoCompanyList(videoCompany);
    }

    /**
     * 新增公司
     * 
     * @param videoCompany 公司
     * @return 结果
     */
    @Override
    public int insertVideoCompany(VideoCompany videoCompany)
    {
        videoCompany.setCreateTime(DateUtils.getNowDate());
        return videoCompanyMapper.insertVideoCompany(videoCompany);
    }

    /**
     * 修改公司
     * 
     * @param videoCompany 公司
     * @return 结果
     */
    @Override
    public int updateVideoCompany(VideoCompany videoCompany)
    {
        videoCompany.setUpdateTime(DateUtils.getNowDate());
        return videoCompanyMapper.updateVideoCompany(videoCompany);
    }

    /**
     * 批量删除公司
     * 
     * @param ids 需要删除的公司主键
     * @return 结果
     */
    @Override
    public int deleteVideoCompanyByIds(String ids)
    {
        return videoCompanyMapper.deleteVideoCompanyByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除公司信息
     * 
     * @param id 公司主键
     * @return 结果
     */
    @Override
    public int deleteVideoCompanyById(Integer id)
    {
        return videoCompanyMapper.deleteVideoCompanyById(id);
    }
}
